package com.hzit.cart.controller;

import com.hzit.cart.api.domain.Address;
import com.hzit.cart.service.IAddressService;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author hbxfwf
 * @since 2023-09-25
 */
@RestController
public class AddressController {

	@Autowired
	private IAddressService addressService;
	//1. 查询所有的地址列表
	@GetMapping("/address/list")
	public R<List<Address>> addressList(){
		List<Address> list = addressService.findAll();
		return R.ok(list);
	}
}
